# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-pyprind
pkgname=('python2-pyprind' 'python-pyprind')
_pkgname=PyPrind
pkgver=2.11.3
pkgrel=5
pkgdesc='Python Progress Indicator Utility.'
arch=('any')
url='https://pypi.org/project/pyprind/#files'
license=('GPL3')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/PyPrind-$pkgver.tar.gz")
sha512sums=('e2eef9f4b71166f38ba18ab27fb50a97b2f761156c05c8ee555fab1952063f45e1a33984a723627b7ba0b504d07aa4f59c0fff18fa999854b8098ec79ecc105f')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-pyprind() {
  depends=('python2' 'python2-psutil')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-pyprind() {
  depends=('python' 'python-psutil')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

